package whf.framework.resource.db;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 * @author wanghaifeng
 * @create Dec 14, 2006 12:04:49 PM
 * 
 */
public class DBHelper {
	/**
	 * 关闭一个数据库对象
	 * @modify wanghaifeng Dec 14, 2006 12:07:05 PM
	 * @param obj
	 */
	public static void close(Object obj){
		if(obj == null) return ;
		try{
			if(obj instanceof Connection){
				((Connection)obj).close();
			}else if(obj instanceof Statement){
				((Statement)obj).close();
			}else if(obj instanceof ResultSet){
				((ResultSet)obj).close();
			}
		}catch(Exception e){
			//ignore;
		}
	}
}
